type Sum = (url:string, method?:string,data?:any,header?:any) => any
export const requset:Sum= (url,method="GET",data,header)=>{
    return new Promise((resolve,reject)=>{
      wx.showLoading({
        title: '加载中',
      })
      wx.request({
        url:"http://101.37.23.156:2219"+url,
        method,
        data,
        header,
        success:(res)=>{
           resolve(res.data)
        },
        fail:(err)=>{
          reject(err)
        },
        complete:()=>{
          wx.hideLoading()
        }
      })
    })
  }

export const requset2:Sum= (url,method="GET",data,header)=>{
    return new Promise((resolve,reject)=>{
      wx.showLoading({
        title: '加载中',
      })
      wx.request({
        url:"http://120.26.90.83:3000"+url,
        method,
        data,
        header,
        success:(res)=>{
           resolve(res.data)
        },
        fail:(err)=>{
          reject(err)
        },
        complete:()=>{
          wx.hideLoading()
        }
      })
    })
  }